home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual Foxpro 6.0 (Ent. Edition) / Vf6ent Extractor.EXE / TOOLS / XSOURCE / XSOURCE.ZIP / vfpsource / wizards / Wzsample / Sample WIzard < prev    next >
Encoding:
Text File  |  1998-05-01  |  4.0 KB  |  84 lines

  1. The HTML Output Wizard demonstrates how a Visual FoxPro user builds a wizard. The finished Wizard takes data from a table or view and generates an HTML document. The user may select a sort method for the table. The final output is an HTML table. The sample wizard will follow the structure of the Form Wizard.
  2.  
  3. The sample wizard consists of three pages. 
  4.  
  5. Page 1 contains a field mover, where the user selects a table or view, and from the table or view, selects fields. 
  6.  
  7. Page 2 contains a sort mover, where the user may select up to three fields by which to sort the results. 
  8.  
  9. Page 3 is the Finish screen. It contains a field for the form title, and the following radio buttons:
  10.  
  11.     1. Save web page
  12.     2. Save web page and open it in browser
  13.     3. Save web page and modify it in editor
  14.  
  15. When the user clicks Finish, the user is prompted for a filename in which to store the generated HTML code. The ProcessOutput function calls the appropriate functions to generate HTML output (as a table) for each record, using the selected sort order.
  16.  
  17. Step text and description text is similar to the text in the Form Wizard. We can use the same BMPs as the Form Wizard uses. 
  18.  
  19.  
  20.  
  21. Steps to construct wizard:
  22.  
  23. 1. Create a folder to hold your project.
  24. 2. Create a new project
  25.  
  26.  
  27. Engine code
  28.  
  29. 3. Open the file WIZSTUB.PRG (located in the WZCOMMON folder), and save as HTMSTART.PRG in your project's folder. Add the file to your wizard's project. This file should be set as your projects MAIN file (under the Project menu).
  30.  
  31. 4. Add the following program files (also located in the WZCOMMON folder): WZENGINE.PRG
  32.  
  33. 5. Create a text file called HTMLWIZ.H in your project's folder. Add the file to your project. This file may be excluded from the final build. For each step in the wizard, add #DEFINEs for :
  34.  
  35.     1. a title -- this appears in the step popup
  36.     2. a description - this appears on the wizard page, and describes what the user needs to do at that step.
  37.     3. the name of the bitmap file that appears on the page
  38.  
  39. 6. Create a new program file called HTMLWIZ.PRG. This file will contain your "engine" code to handle the any special initialization, extra functions, and the final processing of the wizard. It contains a subclass of the WZENGINE class (located in the WZENGINE.PRG file). The Wizard will call your engine's PROCESSOUTPUT function. For the HTML Output Wizard, we need to add code to this function to generate our output.
  40.  
  41. The options the user has selected in the Wizard will be stored in various engine properties for use by this function. We will return to this
  42.  
  43.  
  44. 8. Modify HTMSTART program, and insert the name of your visual class (in this case, HTMLWIZ.VCX).
  45.  
  46.  
  47. UI changes
  48.  
  49. 9. Add the following visual class files (located in the WZCOMMON folder): WIZARD.VCX, WIZCTRL.VCX to the project.
  50.  
  51. 10. Create a new VCX file called HTMLWIZ.VCX in your project's folder. Add the file to your project.
  52.  
  53. 12. Modify the visual class HTML.VCX. Set the INCLUDE file to HTMLWIZ.H.
  54.  
  55. 13. Add code to the INITSTEPS method with one line for each page (except the Finish page):
  56.  
  57.     THIS.AddStep()
  58.  
  59. 14. Add the FieldMover control to page 1. Add the SortMover control to page 2. [do whatever customization is necessary to get these controls to work.
  60.  
  61. 15. Modify VCX to use new wzengine.
  62.  
  63. [Add code to FINISH method -- prep work, verification, get output file]
  64.  
  65. [Add code to PROCESSOUTPUT --> move Wizard UI values to arrays and vars that engine can access]
  66.  
  67. [Modify INIT2 -- to hold aPageRef s]
  68.  
  69. [Modify INITSTEPS --> specify steps in your wizard]
  70.  
  71. [Modify REFRESHSTEPS --> enable/disable pages as necessary]
  72.  
  73. [Modify TABLEREFRESH --> update other pages based on selections in FieldMover]
  74.  
  75. Set CEngineClassName vcx property to name of your engine class (e.g., "HTMLEngine").
  76.  
  77. Set CEngineProcedure vcx property to name of procedure files (WZENGINE, HTMLWIZ)
  78.  
  79.  
  80. 11. Create a folder called BMP in your projects folder. Copy BMP files "OPENTABL.BMP/MSK" and "NEWSORT.BMP/MSK" to that folder, and add those files to your project.
  81.  
  82. <Etc.>
  83.  
  84. Build and test...?